// pages/demo/demo.js
const echarts = require('echarts');
const wc  = require('echarts-wordcloud')
Page({

  /**
   * 页面的初始数据
   */
  data: {
    wordCloudChart:""
  },
  test(){

  },
  onShow(){
    this.setData({wordCloudChart:""})
  },
  world_cloud(dataList) {
    var myChart = echarts.init(wordCloudChart);
    var option = {
        tooltip: {},
        series: [{
            type: 'wordCloud',
            shape: 'smooth',
            gridSize: 2,
            sizeRange: [50, 100],
            rotationRange: [46, 80],
            textStyle: {
                normal: {
                    color: function () {
                        return 'rgb('
                            + [Math.round(Math.random() * 160),
                                Math.round(Math.random() * 160),
                                Math.round(Math.random() * 160)]
                                .join(',') + ')';
                    }
                },
                emphasis: {
                    shadowBlur: 10,
                    shadowColor: '#333'
                }
            },
            data: dataList
        }]
    }
    myChart.setOption(option);
}

})